package com.yinhe.music.yhmusic.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yinhe.music.yhmusic.R;
import com.yinhe.music.yhmusic.model.RadioListInfo;
import com.yinhe.music.yhmusic.utils.SystemUtils;

/**
 * @author hasee
 * @date 2017/8/21
 */

public class RadioSongsAdapter extends BaseQuickAdapter<RadioListInfo.RadioSongs, BaseViewHolder> {

    public RadioSongsAdapter() {
        super(R.layout.new_music_recyclerview_item);
    }

    @Override
    protected void convert(BaseViewHolder helper, RadioListInfo.RadioSongs item) {
        helper.setText(R.id.playlist_song, item.getName())
                .setText(R.id.playlist_singer, item.getCreateTime())
                .setText(R.id.play, (SystemUtils.formatPlay(String.valueOf(item.getPlayNum()))))
                .setText(R.id.song_serial, String.valueOf(helper.getAdapterPosition() + 1))

                .setVisible(R.id.play, true)
                .setVisible(R.id.playlist_more, false)
                .setVisible(R.id.song_serial, true);

    }

}
